"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const tools_1 = __importDefault(require("@colyseus/tools"));
const GameRoom_1 = __importDefault(require("./rooms/GameRoom"));
const api_1 = __importDefault(require("./route/api"));
const monitor_1 = require("@colyseus/monitor");
const playground_1 = require("@colyseus/playground");
const cors = require('cors');
exports.default = (0, tools_1.default)({
    getId: () => "HU PAI",
    // initializeTransport: (opts) => {
    //   return new WebSocketTransport({
    //     ...opts,
    //   });
    // },
    initializeGameServer: (gameServer) => {
        gameServer.define("gameRoom", GameRoom_1.default);
    },
    initializeExpress: (app) => {
        app.use(cors());
        app.get("/", (req, res) => {
            res.send("HELLO WORLD");
        });
        app.use('/api', api_1.default);
        /**
         * Bind @colyseus/monitor
         * It is recommended to protect this route with a password.
         * Read more: https://docs.colyseus.io/tools/monitor/#restrict-access-to-the-panel-using-a-password
         */
        app.use("/colyseus", (0, monitor_1.monitor)());
        app.use("/playground", playground_1.playground);
    },
    beforeListen: () => {
        /**
         * Before before gameServer.listen() is called.
         */
    },
});
